import req from "@/utils/request.js";
/// 登录
export const loginFun = data => {
	return req({
		url: 'wechat/mp_auth',
		method: 'post',
		data
	})
}
// 获取用户手机号
export const mandateTel = data => {
	return req({
		url: 'wechat/getPhoneNumber',
		method: 'post',
		data
	})
}
// 获取用户信息
export const getMyInfo = () => {
	return req({
		url: "personal",
		method: "get"
	})
}
// 编辑个人信息
export const editUserInfo = data => {
	return req({
		url: "personal",
		method: "post",
		data
	})
}
// 获取验证码
export const sendCode = data => {
	return req({
		url: "send_code",
		method: "post",
		data
	})
}
// 服务菜单列表
export const getServeMenu = () => {
	return req({
		url: "center/menu",
		method: "get",
	})
}
// 燃烧卡路里所有接口未分类
/* 获取卡路里运动列表 */
export const getMotionList = data => {
	return req({
		url: "motion_list", 
		method: "get",
		data
	})
}
/* 获取运动图表数据 */
export const exerciseChartData = data => {
	return req({
		url: "motion/data_chart", 
		method: "get",
		data
	})
}
/* 获取指定日期运动列表 */
export const exerciseDateChild = data => {
	return req({
		url: "motion_obvious", 
		method: "get",
		data
	})
}
/* 获取视频筛选 */
export const tabsFilter = data => {
	return req({
		url: "class_list",
		method: "get",
		data
	})
}
// 获取动作库
export const getActionLibrary = data => {
	return req({
		url: "action_library",
		method: "GET",
		data
	})
}
/* 获取蓝牙连接记录 */
export const  getDeviceRecord = () => {
	return req({
		url: "heart_rate_meter/index", 
		method: "get"
	})
}
// 椭圆机加入分组 跑步机
export const ellipticalsIndex = data => {
	return req({
		url: "device/connect",
		method: "POST",
		data
	})
}
/* 添加链接记录 */
export const addDeviceRecord = data => {
	return req({
		url: "heart_rate_meter/create", 
		method: "POST",
		data
	})
}
/* 生成燃烧卡卡路里记录 */
export const motionAdd = data => {
	return req({
		url: "sports/motion_add", 
		method: "post",
		data
	})
}
/* 心率强度列表 */
export const getIntensityList = () => {
	return req({
		url: "getStrength", 
		method: "get",
	})
}
/* 加入投屏分组 */
export const joinScreenGroup = data => {
	return req({
		url: "system/join_group", 
		method: "get",
		data
	})
}
/* 离开投屏分组 */
export const leaveGroup = data => {
	return req({
		url: "system/leave_group", 
		method: "post",
		data
	})
}
/* 设置用户运动的记录*/
export const setUserSportRecord = data => {
	return req({
		url: "setUserSportRecord",
		method: "post",
		data
	})
}
/* 删除用户运动记录*/
export const delUserSportRecord = data => {
	return req({
		url: "delUserSportRecord",
		method: "post",
		data
	})
}
/* 删除我的设备 */
export const delDevice = data => {
	return req({
		url: "heart_rate_meter/delete?sign=" + data, 
		method: "DELETE"
	})
}
/* 修改链接心率带名称 */
export const editDeviceName = data => {
	return req({
		url: "heart_rate_meter/edit", 
		method: "POST",
		data
	})
}
// 蓝牙校正
export const calibration = data => {
	return req({
		url: "calibration",
		method: "PUT",
		data
	})
}